import React from 'react';
import { connect } from 'dva';
import styles from './IndexPage.css';
import { Layout, Menu } from "antd";
import { Link } from 'dva/router';

const { Header, Content } = Layout
const MenuItem = Menu.Item

class IndexPage extends React.Component {
  render() {
    const { children, location } = this.props;
    // console.log(location.pathname)
    return (
      <Header>
        <Menu
          style={{ lineHeight: '64px' }}
          theme="dark"
          selectedKeys={[location.pathname]}
          mode="horizontal">
          <MenuItem key="/index">
            <Link to='/index'>首页</Link>
          </MenuItem>
          <MenuItem key="/sec">
            <Link to='/sec'>第二页</Link>
          </MenuItem>
        </Menu>
        <Content className={styles.homeContent}>
          {children}
        </Content>
      </Header>
    )
  }
}

IndexPage.propTypes = {
};

export default connect()(IndexPage);
